package com.example.cloud.biz.fallback;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import com.example.cloud.biz.UserBiz;
import com.example.cloud.domain.model.user.UserDO;

/**
 * 接口调用失败时，Hystrix的服务降级实现(可选) 有问题
 *
 * @author tongyufu
 */
public class UserBizFallback implements UserBiz {

    @Override
    public UserDO getUser(@RequestHeader("id") Integer id, @RequestHeader("name") String name) {
        return new UserDO(0, "error");
    }

    @Override
    public UserDO getUser(@RequestBody UserDO userInfo) {
        return new UserDO(0, "error");
    }

    @Override
    public UserDO getUserById(@PathVariable("id") Integer id) {
        return null;
    }

}
